package org.example;

import org.example.custom.mybatis.annotatiton.CustomMapperScan;
import org.example.custom.mybatis.mapper.ProductMapper;
import org.example.custom.mybatis.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@CustomMapperScan(basePackages = {"org.example.custom.mybatis.mapper"})
public class CatBootApplication implements ApplicationRunner {

	@Autowired
	private UserMapper userMapper;

	@Autowired
	private ProductMapper productMapper;

	public static void main(String[] args) {
		SpringApplication.run(CatBootApplication.class, args);
	}

	@Override
	public void run(ApplicationArguments args) throws Exception {
		System.out.println(userMapper.listUserNames());
		System.out.println(productMapper.listProductNames());
	}
}
